package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QtRecommendMapper;
import com.ruoyi.system.domain.QtRecommend;
import com.ruoyi.system.service.IQtRecommendService;

/**
 * 推荐Service业务层处理
 * 
 * @author ZQQ
 * @date 2021-11-27
 */
@Service
public class QtRecommendServiceImpl implements IQtRecommendService 
{
    @Autowired
    private QtRecommendMapper qtRecommendMapper;

    /**
     * 查询推荐
     * 
     * @param recomId 推荐主键
     * @return 推荐
     */
    @Override
    public QtRecommend selectQtRecommendByRecomId(String recomId)
    {
        return qtRecommendMapper.selectQtRecommendByRecomId(recomId);
    }

    /**
     * 查询推荐列表
     * 
     * @param qtRecommend 推荐
     * @return 推荐
     */
    @Override
    public List<QtRecommend> selectQtRecommendList(QtRecommend qtRecommend)
    {
        return qtRecommendMapper.selectQtRecommendList(qtRecommend);
    }

    /**
     * 新增推荐
     * 
     * @param qtRecommend 推荐
     * @return 结果
     */
    @Override
    public int insertQtRecommend(QtRecommend qtRecommend)
    {
        String id= IdUtils.randomUUID();
        qtRecommend.setRecomId(id);
        return qtRecommendMapper.insertQtRecommend(qtRecommend);
    }

    /**
     * 修改推荐
     * 
     * @param qtRecommend 推荐
     * @return 结果
     */
    @Override
    public int updateQtRecommend(QtRecommend qtRecommend)
    {
        return qtRecommendMapper.updateQtRecommend(qtRecommend);
    }

    /**
     * 批量删除推荐
     * 
     * @param recomIds 需要删除的推荐主键
     * @return 结果
     */
    @Override
    public int deleteQtRecommendByRecomIds(String[] recomIds)
    {
        return qtRecommendMapper.deleteQtRecommendByRecomIds(recomIds);
    }

    /**
     * 删除推荐信息
     * 
     * @param recomId 推荐主键
     * @return 结果
     */
    @Override
    public int deleteQtRecommendByRecomId(String recomId)
    {
        return qtRecommendMapper.deleteQtRecommendByRecomId(recomId);
    }
}
